package cn.mln521.ioc.demo2;

import org.junit.jupiter.api.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * 三种实例化Bean的方式:
 *      2.使用静态工厂方法实例化(简单工厂模式)
 */
public class Bean2 {

    @Test
    public void demo1() {
        ApplicationContext context = new ClassPathXmlApplicationContext("application.xml");
        Bean2 bean2 = (Bean2) context.getBean("bean2");

    }
}
